const mongoose = require('mongoose')

const Schema = mongoose.Schema

const TypeSchema = new Schema({
  // 车名
  carName: {
    type: String,
    require: true,
  },
  // 行驶距离
  distance: {
    type: String,
    require: true,
  },
  // 厂商
  manufacturer: {
    type: String,
    require: true,
  },
  rent: {
    type: Number,
    require: true,
  },
  img: {
    type: String,
    require: true,
  },
  // 车身结构
  structure: {
    type: String,
  },
  // 级别
  level: {
    type: String,
    require: true,
  },
  // 长/宽/高 (mm)
  size: {
    type: String,
    require: true,
  },
  // 车的种类
  category_id: { type: Schema.Types.ObjectId, ref: 'Category' },
})

const TypeModel = mongoose.model('Type', TypeSchema)

module.exports = TypeModel
